QVAC-18418 fix: route bare-crypto and bare-fetch through imports map#1932
Merged
Merged
Conversation
lauripiisang
reviewed
May 8, 2026
Remove uuid-random and avoid mutating global crypto for ID generation. Require secure randomness with globalThis.crypto or #crypto fallback. Add crypto-browserify as an optional peer and clarify crypto/fetch errors.
lauripiisang
approved these changes
May 8, 2026
yuranich
reviewed
May 8, 2026
yuranich
left a comment
Contributor
There was a problem hiding this comment.
One release hygiene issue: this PR removes uuid-random from packages/rag/package.json, but packages/rag/NOTICE still lists uuid-random@1.3.2. Please regenerate or update the NOTICE before release so the published package attributions match the dependency set.
yuranich
approved these changes
May 8, 2026
Contributor
|
/review |
Contributor
Tier-based Approval Status |
Proletter
pushed a commit
that referenced
this pull request
May 24, 2026
…1932) * fix: route bare-crypto and bare-fetch through imports map * fix(rag): harden crypto and fetch shims Remove uuid-random and avoid mutating global crypto for ID generation. Require secure randomness with globalThis.crypto or #crypto fallback. Add crypto-browserify as an optional peer and clarify crypto/fetch errors. --------- Co-authored-by: Yury Samarin <yuri.a.samarin@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 What problem does this PR solve?
@qvac/ragsawSyntaxError: 'LLMChunkAdapter' not exportedwhen loading the package, even though the export exists in source. This was bundle corruption masquerading as a missing export.@qvac/raghad raw Bare-specific imports (bare-crypto,bare-fetch) in code paths that non-Bare bundlers may still try to resolve.uuid-randomplus a globalcryptomutation, which made import order fragile in runtimes where crypto is not already global.📝 How does it solve it?
package.json#imports:#crypto→bare-cryptoon Bare,node:cryptoon Node, crypto shim for RN/default.#fetch→bare-fetchon Bare, fetch shim for Node/RN/default.#crypto/#fetchinstead of raw Bare imports.QvacErrorRAG { DEPENDENCY_REQUIRED }when the missing capability is actually used.crypto-browserifyas an optional peer for browser/RN consumers that need Node-stylecrypto.createHash, especially HyperDB document hashing.uuid-randomand the globalcryptomutation.generateId()now creates UUID v4 IDs locally using secure randomness fromglobalThis.crypto.getRandomValuesor#crypto.randomBytes/getRandomValues, and throws clearly if neither exists.path.resolve.🧪 How was it tested?
npm run lintpasses.npm run test:unitpasses: 111/111 tests, 599/599 assertions.#crypto/#fetchinstead of hard-codedbare-crypto/bare-fetchpaths.